<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>求圆的周长和面积</title>
    <script>
        window.onload=function(){
            alert("确定要登录本网页吗？")
            document.getElementsByTagName("input")[3].onclick=function(){
                var radius=document.getElementsByTagName("input")[0].value;
                document.getElementsByTagName("input")[1].value=2*Math.PI*radius;
                document.getElementsByTagName("input")[2].value=Math.PI*radius*radius;
            }
            document.getElementsByTagName("input")[4].onclick=function(){
                document.getElementsByTagName("input")[0].value="";
                document.getElementsByTagName("input")[1].value="";
                document.getElementsByTagName("input")[2].value="";
                
            }
        }

    </script>
</head>
<body>
    <h2>求圆的周长和面积</h2>
    <input type="text" name="" id="" placeholder="请输入半径"><br>
    <input type="text" name="" id="" placeholder="周长"><br>
    <input type="text" name="" id="" placeholder="面积"><br>
    <input type="button" value="确定">
    <input type="button" value="重置">
</body>
</html>